<?php 
$data['page_selected'] = 'management';
$this->load->view('constants/header', $data);?>

<style>
	.foundationForm input{
		width:350px;
	}
	.foundationForm textarea{
		width:350px;
	}
</style>

<div id="site_content">
	<?php $this->load->view('constants/sidebar'); ?> 
    <div id="content">
        <!-- insert the page content here -->
        <?php $this->load->view('management/menu'); ?>
        <br /><br /><br /><br />
  		<h3 align="center">Informaci&oacute;n de la Fundaci&oacute;n</h3>
        <?php if($editable == ""){ ?>
        		<h2 style="font-size:10px"><img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp; Todos los campos son obligatorios</h2>
        		<?php echo form_open(base_url().'management/update_foundation'); 
		}?>
        <table class="foundationForm">
			<tr>
            	<td> Nombre </td>
                <td> <input type="text" <?php echo $editable; ?> name="name" id="name" value="<?php echo $foundation['nombre_fundacion']; ?>"> </td>
                <td> <?php echo form_error('name'); ?> </td>
            </tr>
            <tr>
            	<td> Rif </td>
                <td> <input type="text" <?php echo $editable; ?> name="rif" id="rif" value="<?php echo $foundation['rif_fundacion']; ?>"> </td>
                <td> <?php echo form_error('rif'); ?> </td>
            </tr>
            <tr>
                <td rowspan="8">Direcci&oacute;n Fiscal</td>
                <td> 
                    <textarea <?php echo $editable; ?> name="address" id="address" cols="17" rows="10" title="Direcci&oacute;n">
						<?php echo $foundation['direccion_fiscal_fundacion']; ?>
                    </textarea>
                </td>
                <td>
                    <?php echo form_error('address'); ?> 
                </td>
            </tr>
            <tr>
                <td>                        
                    <div class="formField" id="coS">
                        <span class="InputValue" >
                            <?php if ($foundation['pais'] == "") {?> 
                                Pa&iacute;s
                            <?php } ?>
                        </span>
                        <input type="text" title="Pa&iacute;s" <?php echo $editable; ?> name="country" id="country" onfocus="onFocusInput('co')" onblur="onBlurInput('country','co', 'Pa&iacute;s')" value="<?php echo $foundation['pais']; ?>" /> 
                    </div>
                </td>
                <td>
                    <?php echo form_error('country'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="formField" id="stS"> 
                        <span class="InputValue" >
                            <?php if ($foundation['estado'] == "") {?> 
                                Estado
                            <?php } ?>
                        </span>
                        <input type="text" title="Estado" <?php echo $editable; ?> name="state" id="state" onfocus="onFocusInput('st')" onblur="onBlurInput('state','st', 'Estado')" value="<?php echo $foundation['estado']; ?>"/> 
                    </div>
                </td>
                <td>
                    <?php echo form_error('state'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="formField" id="muS">
                        <span class="InputValue">
                            <?php if ($foundation['municipio'] == "") {?> 
                                Municipio
                            <?php } ?>
                        </span>
                        <input type="text" title="Municipio" <?php echo $editable; ?> name="municipality" id="municipality" onfocus="onFocusInput('mu')" onblur="onBlurInput('municipality','mu', 'Municipio')" value="<?php echo $foundation['municipio']; ?>"/>
                    </div>
                    </td>
                <td>
                    <?php echo form_error('municipality'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="formField" id="paS"> 
                        <span class="InputValue">
                            <?php if ($foundation['parroquia'] == "") {?> 
                                Parroquia
                            <?php } ?>
                        </span>
                        <input type="text" title="Parroquia" <?php echo $editable; ?> name="parish" id="parish" onfocus="onFocusInput('pa')" onblur="onBlurInput('parish','pa', 'Parroquia')" value="<?php echo $foundation['parroquia']; ?>"/>
                    </div>
                    </td>
                <td>
                    <?php echo form_error('parish'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="formField" id="avS"> 
                        <span class="InputValue">
                            <?php if ($foundation['avenida'] == "") {?> 
                                Avenida
                            <?php } ?>
                        </span>
                        <input type="text" title="Avenida" <?php echo $editable; ?> name="avenue" id="avenue" onfocus="onFocusInput('av')" onblur="onBlurInput('avenue','av', 'Avenida')" value="<?php echo $foundation['avenida']; ?>"/>
                    </div>
                    </td>
                <td>
                    <?php echo form_error('avenue'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="formField" id="strS"> 
                        <span class="InputValue">
                            <?php if ($foundation['calle'] == "") {?> 
                                Calle
                            <?php } ?>
                        </span>
                        <input type="text" title="Calle" <?php echo $editable; ?> name="street" id="street" onfocus="onFocusInput('str')" onblur="onBlurInput('street','str', 'Calle')" value="<?php echo $foundation['calle']; ?>"/>
                    </div>
                    </td>
                <td>
                    <?php echo form_error('street'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="formField" id="refS"> 
                        <span class="InputValue">
                            <?php if ($foundation['pto_referencia'] == "") {?> 
                                Punto de referencia
                            <?php } ?>
                        </span>
                        <input type="text" title="Punto de referencia" <?php echo $editable; ?> name="reference_point" id="reference_point" onfocus="onFocusInput('ref')" onblur="onBlurInput('reference_point','ref', 'Punto de referencia')" value="<?php echo $foundation['pto_referencia']; ?>"/>
                    </div>
                    </td>
                <td>
                    <?php echo form_error('street'); ?>
                </td>
            </tr>
            <tr>
            	<td> Direcci&oacute;n Comercial </td>
                <td> 
                	<textarea <?php echo $editable; ?> name="business_address" id="business_address" cols="17" rows="10">
						<?php echo $foundation['direccion_comercial']; ?>
                    </textarea>
                </td>
                <td> <?php echo form_error('business_address'); ?> </td>
            </tr>
            <tr>
            	<td> Tel&eacute;fono </td>
                <td> <input type="text" <?php echo $editable; ?> name="phone" id="phone" value="<?php echo $foundation['telefono']; ?>"> </td>
                <td> <?php echo form_error('phone'); ?> </td>
            </tr>
            <tr>
            	<td> Fax </td>
                <td> <input type="text" <?php echo $editable; ?> name="fax" id="fax" value="<?php echo $foundation['telefono_fax']; ?>"> </td>
                <td> <?php echo form_error('fax'); ?> </td>
            </tr>
            <tr>
            	<td> Correo corporativo </td>
                <td> <input type="text" <?php echo $editable; ?> name="business_email" id="business_email" value="<?php echo $foundation['correo_corporativo']; ?>"> </td>
                <td> <?php echo form_error('business_email'); ?> </td>
            </tr>
            <tr>
            	<td> Nombre de env&iacute;o de correos </td>
                <td> <input type="text" <?php echo $editable; ?> name="email_name" id="email_name"
                      				title="Este es el nombre que aparecer&aacute; junto al correo electr&oacute;nico en la bandeja de entrada del destinatario" 
                                    value="<?php echo $foundation['nombre_envio_correo']; ?>"> 
                </td>
                <td> <?php echo form_error('email_name'); ?> </td>
            </tr>
            <tr>
            	<td> Correo de recibo de informaci&oacute;n </td>
                <td> <input type="text" <?php echo $editable; ?> name="info_email" id="info_email" 
                					title="Correo al cual llegar&aacute;n todos los correos informartivos que genere el sistema" 
                                    value="<?php echo $foundation['correo_recibo_de_información']; ?>"> </td>
                <td> <?php echo form_error('info_email'); ?> </td>
            </tr>
            <tr>
            	<td> P&aacute;gina Web </td>
                <td> <input type="text" <?php echo $editable; ?> name="web_page" id="web_page" value="<?php echo $foundation['pag_web']; ?>"> </td>
                <td> <?php echo form_error('web_page'); ?> </td>
            </tr>
            <tr>
            	<td> Seud&oacute;nimo de Twitter </td>
                <td> <input type="text" <?php echo $editable; ?> name="twitter" id="twitter" value="<?php echo $foundation['twitter']; ?>"> </td>
                <td> <?php echo form_error('twitter'); ?> </td>
            </tr>
            <tr>
            	<td> Facebook </td>
                <td> <input type="text" <?php echo $editable; ?> name="facebook" id="facebook" value="<?php echo $foundation['facebook']; ?>"> </td>
                <td> <?php echo form_error('facebook'); ?> </td>
            </tr>
            <tr>
                <td rowspan="4">Representante legal</td>
                <td> 
                    <div class="formField" id="nameS">
                        <span class="InputValue" >
                            <?php if ($foundation['representante_legal'] == "") {?> 
                                Nombre
                            <?php } ?>
                        </span>
                        <input type="text" <?php echo $editable; ?> name="rep_name" id="rep_name" onfocus="onFocusInput('rep_name')" 
                        						title="Nombre del representante legal" 
                        						onblur="onBlurInput('rep_name','name', 'Nombre')" value="<?php echo $foundation['representante_legal']; ?>" /> 
                    </div>
                </td>
                <td>
                    <?php echo form_error('rep_name'); ?> 
                </td>
            </tr>
            <tr>
                <td>                        
                    <div class="formField" id="ciS">
                        <span class="InputValue" >
                            <?php if ($foundation['ci_representante_legal'] == "") {?> 
                                C&eacute;dula
                            <?php } ?>
                        </span>
                        <input type="text" title="C&eacute;dula del representante legal"  <?php echo $editable; ?> name="rep_ci" id="rep_ci" onfocus="onFocusInput('ci')" onblur="onBlurInput('rep_ci','ci', 'C&eacute;dula')" value="<?php echo $foundation['ci_representante_legal']; ?>" /> 
                    </div>
                </td>
                <td>
                    <?php echo form_error('rep_ci'); ?>
                </td>
            </tr>
            <tr>
                <td>                        
                    <div class="formField" id="emailS">
                        <span class="InputValue" >
                            <?php if ($foundation['correo_representante'] == "") {?> 
                                Correo
                            <?php } ?>
                        </span>
                        <input type="text" title="Correo del representante legal"  <?php echo $editable; ?> name="rep_email" id="rep_email" onfocus="onFocusInput('email')" onblur="onBlurInput('rep_email','email', 'Correo del representante')" value="<?php echo $foundation['correo_representante']; ?>" /> 
                    </div>
                </td>
                <td>
                    <?php echo form_error('rep_email'); ?>
                </td>
            </tr>
            <tr>
                <td>                        
                    <div class="formField" id="phoneS">
                        <span class="InputValue" >
                            <?php if ($foundation['telefono_representante'] == "") {?> 
                                Tele&eacute;fono
                            <?php } ?>
                        </span>
                        <input type="text" title="Tel&eacute;fono del representante legal"  <?php echo $editable; ?> name="rep_phone" id="rep_phone" onfocus="onFocusInput('phone')" onblur="onBlurInput('rep_phone','phone', 'Tele&eacute;fono')" value="<?php echo $foundation['telefono_representante']; ?>" /> 
                    </div>
                </td>
                <td>
                    <?php echo form_error('rep_phone'); ?>
                </td>
            </tr>
            <tr>
            	<td colspan="3">
                	<?php if($editable == ""){ ?>
                    	<h2 style="font-size:10px"><img src="<?php echo base_url().IMG; ?>icon_RequiredField.png">&nbsp; Todos los campos son obligatorios</h2>
                    	<input type="submit" name="button" class="submit" value="Procesar" />
                    <?php } else {?>
                    	<a href="<?php echo base_url(); ?>management/foundation/editable" >Editar informaci&oacute;n</a>
                    <?php } ?>
                </td>
            </tr>
        </table>
    </div>
</div>
<script type="text/javascript">	
	function onFocusInput(divId){
		$('#'+divId+'S span').html("");
	}
	
	function onBlurInput(inputId, divId, value){
		if($('#'+inputId+'').val() == "")
			$('#'+divId+'S span').html(value);
		else
			$('#'+divId+'S span').html("");
	}
</script>
<?php $this->load->view('constants/footer'); ?>